package com.entity;

/**
 * @author: create by Young
 * @version: v1.0
 * @description: com.entity
 * @date:2019/3/22 2:14
 */
public class Student {
	private String name;
	private int age;

	public Student() {}

	public Student(String n, int age) {
		this.name = n;
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@Override
	public boolean equals(Object obj)
	{
		if(obj instanceof Student) {
			return ((Student) obj).age == this.age
					&& ((Student) obj).name == this.name;
		}
		return false;
	}

	@Override
	public int hashCode() {
		return this.age + this.name.hashCode();
	}
}
